package edu.scdx.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.scdx.dao.UserInfoMapper;
import edu.scdx.dao.UserMapper;
import edu.scdx.entity.UserInfo;

@Service
public class UserInfoServiceImpl implements UserInfoService{

	@Autowired
    private UserInfoMapper userInfoMapper;

	public UserInfoMapper getUserInfoMapper() {
		return userInfoMapper;
	}

	public void setUserInfoMapper(UserInfoMapper userInfoMapper) {
		this.userInfoMapper = userInfoMapper;
	}

	@Override
	public void addInfo(String userTel, String userName) {
		
		userInfoMapper.insertInfo(userTel,userName);
		
	}

	@Override
	public UserInfo getUserInfo(String userTel) {
		
		UserInfo userInfo=userInfoMapper.getUserInfo(userTel);
		
		return userInfo;
	}

	@Override
	public void updateUserInfo(String userTel,String userName,String userSex,String userBirthday) {
		
		userInfoMapper.updateUserInfo(userTel,userName,userSex,userBirthday);
		
	}

	@Override
	public void updateUserMoney(String userTel,int userMoney) {
		
		userInfoMapper.updateUserMoney(userTel,userMoney);
		
	}

	@Override
	public void updateMoney(String userTel,double price, int rankAdd) {
		
		userInfoMapper.updateMoney(userTel,price, rankAdd);
		
	}

	@Override
	public void updateScore(String userTel, Integer jifen) {
		
		userInfoMapper.updateScore(userTel,jifen);
		
	}

	
	
}
